
// Copyright (C) 2007 Richard Uhler
// This file is part of Esiply.
//
// Esiply is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License, Version 2,
// as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

#ifndef _IF_ELSE_STATEMENT_H_
#define _IF_ELSE_STATEMENT_H_

// if ( expression) statement else statement
// If the expression evalutes to true, execute the if_statement
// (and ignore its result)
// else execute the else_statement.
//#include <gc_allocator.h>

#include "Statement.h"

class Expression;
class Scope;

class IfElseStatement : public Statement
{
public:
    IfElseStatement(Expression* expression, Statement* if_statement,
            Statement* else_statement);
    virtual Value* execute_internal(Scope* scope) const;
    virtual void getDeclaredVariables(std::vector<String*>& ids) const;

private:
    Expression* m_expression;
    Statement* m_if_statement;
    Statement* m_else_statement;
};

#endif//_IF_ELSE_STATEMENT_H_

